package file;

import java.io.File;

public class CreatNewFileDemo {
    public static void main(String[] args) throws Exception {
        for (int i = 1; i < 11; i++) {
            File file = new File("./text"+i+".txt");

            if (file.exists()){
                System.out.println("文件已存在");
            }else{
                file.createNewFile();
                System.out.println("文件"+i+"已创建");
            }
        }
    }
}
